using System;
using System.ComponentModel.DataAnnotations;

namespace Models
{
    /// <summary>
    /// 刷新令牌实体类，用于JWT token的刷新机制
    /// </summary>
    public class RefreshToken
    {
        /// <summary>
        /// 刷新令牌ID，主键
        /// </summary>
        public int Id { get; set; }
        
        /// <summary>
        /// 刷新令牌值，必填
        /// </summary>
        [Required]
        public string Token { get; set; } = null!;
        
        /// <summary>
        /// 关联的用户ID，必填
        /// </summary>
        [Required]
        public string UserId { get; set; } = null!;
        
        /// <summary>
        /// 令牌过期时间
        /// </summary>
        public DateTime ExpiryDate { get; set; }
        
        /// <summary>
        /// 是否已被撤销
        /// </summary>
        public bool IsRevoked { get; set; }
        
        /// <summary>
        /// 关联的用户实体
        /// </summary>
        public virtual ApplicationUser User { get; set; } = null!;
    }
} 